/**
 *  Java Api For Ecco Generated Applications 
 *  
 *  Copyright (C) 2000  by PDTec GmbH 
 *
 *  @author  Michael Weirich
 */

package pdtec.ecco.meta;

/**
 * The class Aggregate provides access to meta data for the specified 
 * aggregation type. 
 *
 * @see  pdtec.ecco.inst.InstApplication
 */
public class Aggregate extends Type {
    
    /** Lower bound of the aggregate. */
    protected long loBound;
    
    /** Higher bound of the aggregate. */
    protected long hiBound;
    
    /**
     * The constructor is protected. Aggregate instances can be created by the 
     * static {@link Type#get(int, long) Type.get(int appId,long typeId) } method. 
     * @param       libName the name of the ecco application dll
     * @exception EccoException in case an error occurs
     * @see       pdtec.ecco.inst.InstApplication#InstApplication( String libName )
     */
    protected Aggregate (int appId,  long typeId) throws EccoException {
	super(appId,typeId);
	setBounds();
    } // Aggregate

    /** The standard constructor is protected.
     * Aggregate instances can be created by the 
     * static {@link Type#get(int, long) Type.get(int appId,long typeId) } method. 
     */
    protected Aggregate() {}
    
    /** Returns the element type of the aggregate.
     * @exception EccoException in case an error occurs
     */
    public native synchronized Type elementType() throws EccoException;

    /** Returns the unique property status of elements.
     * @exception EccoException in case an error occurs 
     */
    public native synchronized boolean isUnique() throws EccoException;

    /** Sets bounds of the aggregate. This method is protected since
     * it is called by the constructor, thus it is not
     * necessary to call it explicitely.
     * @exception EccoException in case an error occurs
     */
    protected native synchronized void setBounds() throws EccoException;

    /** Returns lower bound of the aggregate. */
    public long GetLoBound() { return loBound; }

    /** Returns higher bound of the aggregate. */
    public long GetHiBound() { return hiBound; }
    
    /** Finalizes the aggregate. */
    protected void finalize() {
	super.finalize();
    } // finalize

} // Aggregate











